<template>
  <div>
    <button @click="show=true">点击后载入comp-text</button>
    <comp-text :fld="{name:'test1',placeholder:'部件:comp-text'}" v-if='show'/>
    <el-input  name='test2' placeholder='部件:el-input' />
  </div>
</template>
<script>
define(['vue'],function(vue){
  return vue.component('comp-text-compose',{
    props:['fld','value','readonly','disabled'],
    components:{
      // 异步载入
      'comp-text' :  resolve=>require(['_vue!Jichu/TestAsync/Components/comp-text'], resolve)
    },
    data: function(){
      return {
        'show':false
      }
    },
    template: template,
    methods:{
      handleModelInput :function(val){
        this.$emit("input", val);
      },
      handleChange :function(val){
        var key = `${this.fld.name}:change`;
        if(!this.$root.callbacks[key]) return;
        this.$root.callbacks[key].apply(this,arguments);
      },
    }
  });  
});

</script>